<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2008 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/conformanceFunction.xsl"?>
<testcase
  xmlns="http://xbrl.org/2008/conformance"
  xmlns:reg="http://xbrl.org/2008/registry"
  xmlns:fcn="http://xbrl.org/2008/function"
  xmlns:cfcn="http://xbrl.org/2008/conformance/function"
  xmlns:xbrli="http://www.xbrl.org/2003/instance"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xfi="http://www.xbrl.org/2008/function/instance"
  xmlns:xfie="http://www.xbrl.org/2008/function/instance/error"
  xmlns:xqt-err="http://www.w3.org/2005/xqt-errors"
  xmlns:t="http://xbrl.org/formula/conformance/example" 
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  http://xbrl.org/2008/conformance ../schemas/conformance.xsd
  http://xbrl.org/2008/conformance/function ../schemas/conformanceFunction.xsd
  ">
  <owners>
    <reg:owner id="herm">
      <reg:name>Herm Fischer</reg:name>
      <reg:affiliation>UBMatrix / Mark V Systems</reg:affiliation>
      <reg:email>fischer@markv.com</reg:email>
     <reg:assumedOwnership moment="2008-02-06T15:50:00" />
    </reg:owner>
  </owners>

  <number>90305</number>

  <name>xfi:scenario-remainder</name>

  <documentation>
    <xhtml:p>
      This testcase is the same as 90304 except that scenario is
      substituted for segment.
    </xhtml:p>
  </documentation>

  <reference
    xlink:type="simple"
    xlink:href="90305 xfi.fact-scenario-remainder function.xml">
    function definition
  </reference>

  <variation id="V-01">
    <name>Scenario remainder for everest which has two elements mixed with dimensions</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-scenario-remainder.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-scenario-remainder-definition.xml"/>
      <instance readMeFirst="true" id="V01" xlink:type="simple" xlink:href="fact-scenario-remainder-instance1.xml"/>
      <cfcn:call file="V01">
        xfi:fact-scenario-remainder(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Everest'] 
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of element(*)* and
         count( $result ) eq 2 and
         local-name($result[1]) eq 'NeedOxygen' and
         $result[1]/@id eq 'ev1' and
         local-name($result[2]) eq 'HasWifiAccess' and
         $result[2]/@id eq 'ev2'
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-02">
   <name>Scenario remainder for vinson which has complex type structures intermixed with dimensions</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-scenario-remainder.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-scenario-remainder-definition.xml"/>
      <instance readMeFirst="true" id="V02" xlink:type="simple" xlink:href="fact-scenario-remainder-instance1.xml"/>
      <cfcn:call file="V02">
        xfi:fact-scenario-remainder(
          /xbrli:xbrl/t:Peak[./text() eq 'Vinson Massif'] 
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of element(*)* and
         count( $result ) eq 3 and
         local-name($result[1]) eq 'Element1' and
         $result[1]/@id eq 'e1' and
         $result[1] is //t:Element1[@id='e1'] and
         local-name($result[2]) eq 'Stuff' and
         $result[2]/@id eq 's1' and
         $result[2] is //t:Stuff[@id='s1'] and
         local-name($result[3]) eq 'Stuff' and
         $result[3]/@id eq 's4' and
         $result[3] is //t:Stuff[@id='s4'] and
         $result[3]/t:Element3/@id eq 's4e3'
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-03">
   <name>Scenario remainder for kilimanjaro is empty</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-scenario-remainder.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-scenario-remainder-definition.xml"/>
      <instance readMeFirst="true" id="V03" xlink:type="simple" xlink:href="fact-scenario-remainder-instance1.xml"/>
      <cfcn:call file="V03">
        xfi:fact-scenario-remainder(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Kilimanjaro'] 
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         empty( $result )
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-04">
   <name>Scenario remainder for scenario-less quark is empty</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-scenario-remainder.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-scenario-remainder-definition.xml"/>
      <instance readMeFirst="true" id="V04" xlink:type="simple" xlink:href="fact-scenario-remainder-instance1.xml"/>
      <cfcn:call file="V04">
        xfi:fact-scenario-remainder(
          /xbrli:xbrl/t:OtherPhenomenon[./text() eq 'Quark'] 
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         empty( $result )
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-05">
   <name>Scenario remainder for ozone hole returns typed attribute and element nodes</name>
    <documentation>
      <xhtml:p>
         Checks element typing, data typing, and atomization.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-scenario-remainder.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-scenario-remainder-definition.xml"/>
      <instance readMeFirst="true" id="V05" xlink:type="simple" xlink:href="fact-scenario-remainder-instance1.xml"/>
      <cfcn:call file="V05">
        xfi:fact-scenario-remainder(
          /xbrli:xbrl/t:AtmosphericPhenomenon 
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result[1]/*[1]/*[1] instance of element(t:Element4) and
         $result[1]/*[1]/*[1]/@intAttr instance of attribute(*,xs:integer) and
         $result[1]/*[1]/*[1]/@qnAttr instance of attribute(*,xs:QName) and
         $result[1]/*[1]/*[1]/*[1] instance of element(t:intElt,xs:integer) and
         $result[1]/*[1]/*[1]/*[2] instance of element(t:qnElt,xs:QName) and
         data( $result[1]/*[1]/*[1]/@intAttr ) instance of xs:integer and
         data( $result[1]/*[1]/*[1]/@qnAttr ) instance of xs:QName and
         data( $result[1]/*[1]/*[1]/*[1] ) instance of xs:integer and
         data( $result[1]/*[1]/*[1]/*[2] ) instance of xs:QName and
         ($result[1]/*[1]/*[1]/@intAttr + 1 eq 12346) and
         ($result[1]/*[1]/*[1]/@qnAttr eq QName('http://xbrl.org/formula/conformance/example','Element1') ) and
         ($result[1]/*[1]/*[1]/*[1] + 1 eq 54322 ) and
         ($result[1]/*[1]/*[1]/*[2] eq QName('http://xbrl.org/formula/conformance/example','Element2') )
      </cfcn:test>
    </outputs>
  </variation>

  <revisions>
    <reg:revision on="2008-02-06T15:50:00" by="herm">
      <xhtml:p>
        Created the test case.
      </xhtml:p>
    </reg:revision>
    <reg:revision on="2008-12-05T00:00:00" by="herm">
      <xhtml:p>
        Added typed nodes test v-05.
      </xhtml:p>
    </reg:revision>
  </revisions>

</testcase>









